<script setup lang='ts'>
import InputRange from './input-range.vue'

const skuPriceType = defineModel<number>('skuPriceType', { required: true })
const skuPrice = defineModel<any>('skuPrice', { required: true })

// watchEffect(() => {

// })
// watch(() => skuPriceType, (val) => {
//     console.log(val, '11111')
//     if (Number(val) === 3) {
//         skuPrice.value = ''
//     }
//     else {
//         skuPrice.value = 1
//     }
// })
</script>

<template>
    <div v-if="!skuPriceType && skuPriceType !== 0">
        请先选择价格类型
    </div>

    <div v-if="skuPriceType === 3">
        略
    </div>

    <el-input-number v-if="skuPriceType === 2"
                     v-model="skuPrice"
                     placeholder="请输入"
                     :min="1"
                     :max="999999"
                     controls-position="right"
    />

    <el-input-number v-if="skuPriceType === 1"
                     v-model="skuPrice"
                     placeholder="请输入"
                     :min="1"
                     :max="999999"
                     controls-position="right"
    />

    <InputRange v-if="skuPriceType === 0"
                v-model:skuPrice="skuPrice"
    />
</template>
